<?php
// +----------------------------------------------------------------------
// | sfadmin - Suifeng Administration
// +----------------------------------------------------------------------
// | Copyright (c) 2017-2020 http://suifeng.tech All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: suifeng <1787585212@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\helper;

use think\Session;

final class Flash
{
    public function info($content)
    {
        Session::push('_flash_message', array(
            'level' => 'info',
            'content' => $content,
        ));
    }

    public function warn($content)
    {
        Session::push('_flash_message', array(
            'level' => 'warning',
            'content' => $content,
        ));
    }

    public function error($content)
    {
        Session::push('_flash_message', array(
            'level' => 'error',
            'content' => $content,
        ));
    }

    public function all()
    {
        $list = Session::pull('_flash_message');
        return $list;
    }
}